<template>
  <div class="pop">
    <div class="mask" />
    <div class="pop">
      <div>这是一个普通弹窗</div>
      <div class="close" @click="close">X</div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component
export default class NomalPop extends Vue {
  close() {
    this.$emit('close');
  }
}
</script>

<style lang="less">
.pop {
  position: fixed !important;
  width: 100%;
  height: 100%;
  .mask {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
  }
  .pop {
    position: absolute;
    width: 200px;
    height: 300px;
    background: #fff;
    border-radius: 10px;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .close {
    width: 20px;
    height: 20px;
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    border-radius: 5px;
    background: grey;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
  }
}
</style>
